import axios from '@/utils/axios';

export const page = (data) => {
    return axios.request({
        url: '/domain/page?siteId=' + data.siteId,
        method: 'get'
    });
};

export const bindDomainName = (data) => {
    return axios.request({
        url: '/domain/',
        method: 'post',
        data
    });
};

export const updateDefaultDomainName = (data) => {
    return axios.request({
        url: '/domain/',
        method: 'put',
        data
    });
};

export const getAvailableDomainName = (data) => {
    return axios.request({
        url: '/domain/available?siteId=' + data.siteId,
        method: 'get'
    });
};

export const delDomainName = (id, siteId) => {
    return axios.request({
        url: '/domain/' + id + '/' + siteId,
        method: 'delete'
    });
};

// 配置多域名信息
export const updateDomainSetting = (data) => {
    return axios.request({
        url: '/domain/updateDomainSetting',
        method: 'put',
        data
    });
};

// 获取域名列表信息
export const getListForDecoration = (siteId) => {
    return axios.request({
        url: '/domain/getListForDecoration',
        method: 'get',
        params: {siteId}
    });
};
